home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / CIncludes / Icons.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-17  |  8.1 KB  |  313 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Icons.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12. #ifndef __ICONS__
  13. #define __ICONS__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. #endif
  18.  
  19. #ifndef __QUICKDRAW__
  20. #include <QuickDraw.h>
  21. #endif
  22.  
  23. enum {
  24.  
  25.  
  26. /* The following are icons for which there are both icon suites and SICNs. */
  27.  genericDocumentIconResource = -4000,
  28.  genericStationeryIconResource = -3985,
  29.  genericEditionFileIconResource = -3989,
  30.  genericApplicationIconResource = -3996,
  31.  genericDeskAccessoryIconResource = -3991,
  32.  
  33.  genericFolderIconResource = -3999,
  34.  privateFolderIconResource = -3994,
  35.  
  36.  floppyIconResource = -3998,
  37.  trashIconResource = -3993,
  38.  
  39. /* The following are icons for which there are SICNs only. */
  40.  desktopIconResource = -3992,
  41.  openFolderIconResource = -3997,
  42.  genericHardDiskIconResource = -3995,
  43.  genericFileServerIconResource = -3972,
  44.  genericSuitcaseIconResource = -3970,
  45.  genericMoverObjectIconResource = -3969,
  46.  
  47. /* The following are icons for which there are icon suites only. */
  48.  genericPreferencesIconResource = -3971,
  49.  genericQueryDocumentIconResource = -16506,
  50.  genericExtensionIconResource = -16415,
  51.  
  52.  systemFolderIconResource = -3983,
  53.  appleMenuFolderIconResource = -3982
  54. };
  55. enum {
  56.  startupFolderIconResource = -3981,
  57.  ownedFolderIconResource = -3980,
  58.  dropFolderIconResource = -3979,
  59.  sharedFolderIconResource = -3978,
  60.  mountedFolderIconResource = -3977,
  61.  controlPanelFolderIconResource = -3976,
  62.  printMonitorFolderIconResource = -3975,
  63.  preferencesFolderIconResource = -3974,
  64.  extensionsFolderIconResource = -3973,
  65.  
  66.  fullTrashIconResource = -3984
  67.  
  68.  
  69. #define large1BitMask 'ICN#'
  70. #define large4BitData 'icl4'
  71. #define large8BitData 'icl8'
  72. #define small1BitMask 'ics#'
  73. #define small4BitData 'ics4'
  74. #define small8BitData 'ics8'
  75. #define mini1BitMask 'icm#'
  76. #define mini4BitData 'icm4'
  77. #define mini8BitData 'icm8'
  78. };
  79.  
  80. /*  alignment type values  */
  81.  
  82. enum {
  83. atNone = 0x0,
  84. atVerticalCenter = 0x1,
  85. atTop = 0x2,
  86. atBottom = 0x3,
  87. atHorizontalCenter = 0x4,
  88. atAbsoluteCenter = (atVerticalCenter | atHorizontalCenter),
  89. atCenterTop = (atTop | atHorizontalCenter),
  90. atCenterBottom = (atBottom | atHorizontalCenter),
  91. atLeft = 0x8,
  92. atCenterLeft = (atVerticalCenter | atLeft),
  93. atTopLeft = (atTop | atLeft),
  94. atBottomLeft = (atBottom | atLeft),
  95. atRight = 0xC,
  96. atCenterRight = (atVerticalCenter | atRight),
  97. atTopRight = (atTop | atRight),
  98. atBottomRight = (atBottom | atRight)
  99. };
  100. typedef short IconAlignmentType;
  101.  
  102.  
  103. /*  transform type values  */
  104. enum {
  105. ttNone = 0x0,
  106. ttDisabled = 0x1,
  107. ttOffline = 0x2,
  108. ttOpen = 0x3,
  109. ttLabel1 = 0x0100,
  110. ttLabel2 = 0x0200,
  111. ttLabel3 = 0x0300,
  112. ttLabel4 = 0x0400,
  113. ttLabel5 = 0x0500,
  114. ttLabel6 = 0x0600,
  115. ttLabel7 = 0x0700,
  116. ttSelected = 0x4000,
  117. ttSelectedDisabled = (ttSelected | ttDisabled),
  118. ttSelectedOffline = (ttSelected | ttOffline),
  119. ttSelectedOpen = (ttSelected | ttOpen)
  120. };
  121. typedef short IconTransformType;
  122.  
  123.  
  124. /*  Selector mask values  */
  125. enum {
  126. svLarge1Bit = 0x00000001,
  127. svLarge4Bit = 0x00000002,
  128. svLarge8Bit = 0x00000004,
  129. svSmall1Bit = 0x00000100,
  130. svSmall4Bit = 0x00000200,
  131. svSmall8Bit = 0x00000400,
  132. svMini1Bit = 0x00010000,
  133. svMini4Bit = 0x00020000,
  134. svMini8Bit = 0x00040000,
  135. svAllLargeData = 0x000000ff,
  136. svAllSmallData = 0x0000ff00,
  137. svAllMiniData = 0x00ff0000,
  138. svAll1BitData = (svLarge1Bit | svSmall1Bit | svMini1Bit),
  139. svAll4BitData = (svLarge4Bit | svSmall4Bit | svMini4Bit),
  140. svAll8BitData = (svLarge8Bit | svSmall8Bit | svMini8Bit),
  141. svAllAvailableData = 0xffffffff
  142. };
  143. typedef unsigned long IconSelectorValue;    
  144.  
  145. typedef pascal OSErr (*IconAction)(ResType theType, Handle *theIcon, void *yourDataPtr);
  146. typedef pascal Handle (*IconGetter)(ResType theType, void *yourDataPtr);
  147.  
  148. #ifdef __cplusplus
  149. extern "C" {
  150. #endif
  151.  
  152. pascal OSErr PlotIconID(const Rect *theRect,
  153.                             IconAlignmentType align,
  154.                             IconTransformType transform,
  155.                             short theResID)
  156.     = {0x303C, 0x0500, 0xABC9};
  157.     
  158. pascal OSErr NewIconSuite(Handle *theIconSuite)
  159.     = {0x303C, 0x0207, 0xABC9};
  160.     
  161. pascal OSErr AddIconToSuite(Handle theIconData,
  162.                             Handle theSuite,
  163.                             ResType theType)
  164.     = {0x303C, 0x0608, 0xABC9};
  165.     
  166. pascal OSErr GetIconFromSuite(Handle *theIconData,
  167.                             Handle theSuite,
  168.                             ResType theType)
  169.     = {0x303C, 0x0609, 0xABC9};
  170.     
  171. pascal OSErr ForEachIconDo(Handle theSuite,
  172.                             IconSelectorValue selector,
  173.                             IconAction action,
  174.                             void *yourDataPtr)
  175.     = {0x303C, 0x080A, 0xABC9};
  176.     
  177. pascal OSErr GetIconSuite(Handle *theIconSuite,
  178.                             short theResID,
  179.                             IconSelectorValue selector)
  180.     = {0x303C, 0x0501, 0xABC9};
  181.     
  182. pascal OSErr DisposeIconSuite(Handle theIconSuite,
  183.                             Boolean disposeData)
  184.     = {0x303C, 0x0302, 0xABC9};
  185.     
  186. pascal OSErr PlotIconSuite(const Rect *theRect,
  187.                             IconAlignmentType align,
  188.                             IconTransformType transform,
  189.                             Handle theIconSuite)
  190.     = {0x303C, 0x0603, 0xABC9};
  191.     
  192. pascal OSErr MakeIconCache(Handle *theHandle,
  193.                             IconGetter makeIcon,
  194.                             void *yourDataPtr)
  195.     = {0x303C, 0x0604, 0xABC9};
  196.     
  197. pascal OSErr LoadIconCache(const Rect *theRect,
  198.                             IconAlignmentType align,
  199.                             IconTransformType transform,
  200.                             Handle theIconCache)
  201.     = {0x303C, 0x0606, 0xABC9};
  202.  
  203. pascal OSErr PlotIconMethod(const Rect *theRect,
  204.                             IconAlignmentType align,
  205.                             IconTransformType transform,
  206.                             IconGetter theMethod,
  207.                             void *yourDataPtr)
  208.     = {0x303C, 0x0805, 0xABC9};
  209.     
  210. pascal OSErr GetLabel(short labelNumber,
  211.                             RGBColor *labelColor,
  212.                             Str255 labelString)
  213.     = {0x303C, 0x050B, 0xABC9};
  214.     
  215. pascal Boolean PtInIconID(Point testPt,
  216.                             const Rect *iconRect,                /* <22> */
  217.                             IconAlignmentType align,
  218.                             short iconID)
  219.     = {0x303C, 0x060D, 0xABC9};
  220.     
  221. pascal Boolean PtInIconSuite(Point testPt,
  222.                             const Rect *iconRect,                /* <22> */
  223.                             IconAlignmentType align,
  224.                             Handle theIconSuite)
  225.     = {0x303C, 0x070E, 0xABC9};
  226.     
  227. pascal Boolean PtInIconMethod(Point testPt,
  228.                             const Rect *iconRect,                /* <22> */
  229.                             IconAlignmentType align,
  230.                             IconGetter theMethod,
  231.                             void *yourDataPtr)
  232.     = {0x303C, 0x090F, 0xABC9};
  233.     
  234. pascal Boolean RectInIconID(const Rect *testRect,
  235.                             const Rect *iconRect,                /* <22> */
  236.                             IconAlignmentType align,
  237.                             short iconID)
  238.     = {0x303C, 0x0610, 0xABC9};
  239.     
  240. pascal Boolean RectInIconSuite(const Rect *testRect,
  241.                             const Rect *iconRect,                /* <22> */
  242.                             IconAlignmentType align,
  243.                             Handle theIconSuite)
  244.     = {0x303C, 0x0711, 0xABC9};
  245.     
  246. pascal Boolean RectInIconMethod(const Rect *testRect,
  247.                             const Rect *iconRect,                /* <22> */
  248.                             IconAlignmentType align,
  249.                             IconGetter theMethod,
  250.                             void *yourDataPtr)
  251.     = {0x303C, 0x0912, 0xABC9};
  252.     
  253. pascal OSErr IconIDToRgn(RgnHandle theRgn,
  254.                             const Rect *iconRect,                /* <22> */
  255.                             IconAlignmentType align,
  256.                             short iconID)
  257.     = {0x303C, 0x0613, 0xABC9};
  258.     
  259. pascal OSErr IconSuiteToRgn(RgnHandle theRgn,
  260.                             const Rect *iconRect,                /* <22> */
  261.                             IconAlignmentType align,
  262.                             Handle theIconSuite)
  263.     = {0x303C, 0x0714, 0xABC9};
  264.     
  265. pascal OSErr IconMethodToRgn(RgnHandle theRgn,
  266.                             const Rect *iconRect,                /* <22> */
  267.                             IconAlignmentType align,
  268.                             IconGetter theMethod,
  269.                             void *yourDataPtr)
  270.     = {0x303C, 0x0915, 0xABC9};
  271.     
  272. pascal OSErr SetSuiteLabel(Handle theSuite, short theLabel)
  273.     = {0x303C, 0x0316, 0xABC9};
  274.  
  275. pascal short GetSuiteLabel(Handle theSuite)
  276.     = {0x303C, 0x0217, 0xABC9};
  277.  
  278. pascal OSErr GetIconCacheData(Handle theCache, void **theData)
  279.     = {0x303C, 0x0419, 0xABC9};
  280.         
  281. pascal OSErr SetIconCacheData(Handle theCache, void *theData)
  282.     = {0x303C, 0x041A, 0xABC9};
  283.         
  284. pascal OSErr GetIconCacheProc(Handle theCache, IconGetter *theProc)
  285.     = {0x303C, 0x041B, 0xABC9};
  286.         
  287. pascal OSErr SetIconCacheProc(Handle theCache, IconGetter theProc)
  288.     = {0x303C, 0x041C, 0xABC9};
  289.     
  290. pascal OSErr PlotIconHandle(const Rect *theRect,
  291.                             IconAlignmentType align,
  292.                             IconTransformType transform,
  293.                             Handle theIcon)
  294.     = {0x303C, 0x061D, 0xABC9};
  295.     
  296. pascal OSErr PlotSICNHandle(const Rect *theRect,
  297.                             IconAlignmentType align,
  298.                             IconTransformType transform,
  299.                             Handle theSICN)
  300.     = {0x303C, 0x061E, 0xABC9};
  301.     
  302. pascal OSErr PlotCIconHandle(const Rect *theRect,
  303.                             IconAlignmentType align,
  304.                             IconTransformType transform,
  305.                             CIconHandle theCIcon)
  306.     = {0x303C, 0x061F, 0xABC9};
  307.     
  308. #ifdef __cplusplus
  309. }
  310. #endif
  311.  
  312. #endif
  313.